package com.sugar.follow.up.module.business.dal.mysql.followuptemplate;

import java.util.*;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.dal.dataobject.followuptemplate.FollowUpTemplateDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.follow.up.module.business.controller.admin.followuptemplate.vo.*;

/**
 * 随访模板 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface FollowUpTemplateMapper extends BaseMapperX<FollowUpTemplateDO> {

    default PageResult<FollowUpTemplateDO> selectPage(FollowUpTemplatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FollowUpTemplateDO>()
                .eqIfPresent(FollowUpTemplateDO::getTitle, reqVO.getTitle())
                .betweenIfPresent(FollowUpTemplateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FollowUpTemplateDO::getId));
    }

}